export const request = (params) => {
  return new Promise((res, rej) => {
    wx.request({
      ...params,
      success: (result) => {
        res(result)
      },
      fail: (err) => {
        rej(err)
      }
    });
  })
}

export const login = () => {
  return new Promise((res, rej) => {
    wx.login({
      timeout: 10000,
      success: (result) => {
        res(result)
      },
      fail: (err) => {
        rej(err)
      }
    });
  })
}